﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace FacePrep
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectoryInfo dataDir;
            DirectoryInfo outputDir;
            double haarFaceScaleFactor;
            double haarEyeScaleFactor;

            int argIndex = 0;
            string dbSwitch = args[argIndex++];
            switch(dbSwitch)
            {
                case "feret":
                    // parse the command line args
                    haarFaceScaleFactor = Convert.ToDouble(args[argIndex++]);
                    haarEyeScaleFactor = Convert.ToDouble(args[argIndex++]);
                    dataDir = new DirectoryInfo(args[argIndex++]);
                    outputDir = new DirectoryInfo(args[argIndex++]);

                    var feretFace = new FeretFace(dataDir, outputDir, haarFaceScaleFactor, haarEyeScaleFactor);

                    feretFace.prepareData();
                    feretFace.cropFace();
                    break;

                case "yale":
                    // parse the command line args
                    haarFaceScaleFactor = Convert.ToDouble(args[argIndex++]);
                    haarEyeScaleFactor = Convert.ToDouble(args[argIndex++]);
                    dataDir = new DirectoryInfo(args[argIndex++]);
                    outputDir = new DirectoryInfo(args[argIndex++]);

                    var yaleFace = new Yaleface(dataDir, outputDir, haarFaceScaleFactor, haarEyeScaleFactor);

                    yaleFace.prepareData();
                    yaleFace.cropFace();
                    break;
            }
            
        }
    }
}
